package com.jinmdz.fmis.dao.dao.provider;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL;


/**
 * 火化证打印
 *
 * @author GuanKui
 * @date 2020/2/19 17:14
 */
public class CremationCertificatePrintingHistoryProvider {


    /**
     * 根据business_code获取火化证打印历史列表
     *
     * @param businessCode 业务编码
     * @return
     * @author GuanKui
     * @date 2020/2/19  17:14
     */
    public String listCremationCertificatePrintingHistoryByBusinessCode(@Param("businessCode") String businessCode) {
        return new SQL() {
            {
                StringBuilder builder = new StringBuilder();
                builder.append(" id,business_code,member_id,member_name,member_gender_code,certificate_type_code,cremation_old_no,cremation_new_no");
                builder.append(" ,certificate_no,member_relation,operation_cause,operation_type_code,operation_time,mobile_phone");
                SELECT(builder.toString());
                FROM(" cremation_certificate_printing_history ");
                WHERE(" business_code = #{businessCode} and deleted=0  ");
                ORDER_BY(" operation_time ");
            }
        }.toString();
    }
}
